package com.infocollect.project.grant.service.impl;

import java.util.List;
import com.infocollect.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.infocollect.project.grant.mapper.GrGranttypeMapper;
import com.infocollect.project.grant.domain.GrGranttype;
import com.infocollect.project.grant.service.IGrGranttypeService;

/**
 * 项目类型Service业务层处理
 * 
 * @author infocollect
 * @date 2022-05-14
 */
@Service
public class GrGranttypeServiceImpl implements IGrGranttypeService 
{
    @Autowired
    private GrGranttypeMapper grGranttypeMapper;

    /**
     * 查询项目类型
     * 
     * @param id 项目类型ID
     * @return 项目类型
     */
    @Override
    public GrGranttype selectGrGranttypeById(Long id)
    {
        return grGranttypeMapper.selectGrGranttypeById(id);
    }

    /**
     * 查询项目类型列表
     * 
     * @param grGranttype 项目类型
     * @return 项目类型
     */
    @Override
    public List<GrGranttype> selectGrGranttypeList(GrGranttype grGranttype)
    {
        return grGranttypeMapper.selectGrGranttypeList(grGranttype);
    }

    /**
     * 新增项目类型
     * 
     * @param grGranttype 项目类型
     * @return 结果
     */
    @Override
    public int insertGrGranttype(GrGranttype grGranttype)
    {
        grGranttype.setCreateTime(DateUtils.getNowDate());
        return grGranttypeMapper.insertGrGranttype(grGranttype);
    }

    /**
     * 修改项目类型
     * 
     * @param grGranttype 项目类型
     * @return 结果
     */
    @Override
    public int updateGrGranttype(GrGranttype grGranttype)
    {
        return grGranttypeMapper.updateGrGranttype(grGranttype);
    }

    /**
     * 批量删除项目类型
     * 
     * @param ids 需要删除的项目类型ID
     * @return 结果
     */
    @Override
    public int deleteGrGranttypeByIds(Long[] ids)
    {
        return grGranttypeMapper.deleteGrGranttypeByIds(ids);
    }

    /**
     * 删除项目类型信息
     * 
     * @param id 项目类型ID
     * @return 结果
     */
    @Override
    public int deleteGrGranttypeById(Long id)
    {
        return grGranttypeMapper.deleteGrGranttypeById(id);
    }
}
